package com.example.springboot005tx.mapper;

import com.example.springboot005tx.pojo.UserInfo;
import com.example.springboot005tx.provider.UserInfoProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

public interface UserInfoMapper {


    @InsertProvider(type = UserInfoProvider.class, method = "insert")
    @ResultMap("userInfo")
    int insert(UserInfo userInfo);

    @SelectProvider(type = UserInfoProvider.class, method = "selectById")
    @ResultMap("userInfo")
    UserInfo selectById(Integer id);

    @SelectProvider(type = UserInfoProvider.class, method = "selectAll")
    @ResultMap("userInfo")
    List<UserInfo> selectAll();
}
